package com.billdowney.entity.base;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

import org.hibernate.annotations.GenericGenerator;

import io.swagger.annotations.ApiModelProperty;

/**
 * @ClassName: BaseEntityUUIDHex
 * @Description: 通过UUID生成hex的ID，继承了基础属性
 * @author 超级小富翁 - BillDowney
 * @date 2018年3月8日 下午10:41:53
 */
@MappedSuperclass
public class BaseEntityIdByUUIDHex extends BaseEntityProperty implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(length = 32)
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@GeneratedValue(generator = "generator")
	@ApiModelProperty(value = "id", notes = "使用hibernate自动生成字符id")
	private String id;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

}
